package com.sgb.kjwl.view.widget;

import android.content.Context;
import android.view.View;

import com.sgb.kjwl.R;
import com.swgk.core.dialog.BasePopWindow;
import com.swgk.core.dialog.PopViewHolder;

public class BaojiaTypeWindow extends BasePopWindow {

    protected OnClickCallBack onClickCallBack;

    public BaojiaTypeWindow(Context context) {
        super(context, DIR_DEFULAT_WRAP);
    }

    @Override
    protected int popLayout() {
        return R.layout.popwindow_baojia_type_search;
    }

    @Override
    protected void initView(PopViewHolder holder) {
        holder.getPop().findViewById(R.id.scan_layout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onClickCallBack != null) {
                    onClickCallBack.scan();
                }
                dissMiss();
            }
        });
        holder.getPop().findViewById(R.id.team_layout).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onClickCallBack != null) {
                    onClickCallBack.message();
                }
                dissMiss();
            }
        });
    }

    @Override
    public void dismiss() {
        super.dismiss();
        clearAlpha();
    }

    public void setOnClickCallBack(OnClickCallBack onClickCallBack) {
        this.onClickCallBack = onClickCallBack;
    }

    public interface OnClickCallBack {
        void scan();

        void message();
    }
}
